Message Authentication Mode Numbers

The MAC commands specified in the following sections have associated "mode" numbers in the range 0 to 3, as follows:

 

Mode 0:        Normal mode. Used to generate the MAC for a message which completely fits in the HSM buffer, which is 800 bytes or characters long.

 

Mode 1:        Extended message (first block). Used to process the first 800 characters (maximum) of a message greater than 800 characters. The output is an intermediate value to be used as the Initialisation Vector for the next stage.

 

Mode 2:        Extended message (middle block(s)). Used to process each complete 800 (maximum) character block after the first block for a message that exceeds 1600 characters. Requires an Initialisation Vector, and produces one for the next stage.

 

Mode 3:        Extended message (last block). Used to process the last block of less than 800 characters of an extended message. Requires an Initialisation Vector, and produces the final MAC.

 

For binary MAC functions, using modes 1 and 2, the number of message bytes supplied must be a multiple of eight, otherwise a length error (error 80) is returned. For MAC functions where binary data is input as two hexadecimal characters, the number of characters supplied must be a multiple of sixteen (i.e. 8 bytes when compressed).

For modes 0 and 3 the HSM appends binary zeros up to an eight byte (64 bit) boundary if insufficient data is supplied.